<%
    if (session.getAttribute("userid") == null || !session.getAttribute("tipo_utente").toString().equals("1")) {
        session.invalidate();
        getServletContext().getRequestDispatcher("/MainController?q=index").forward(request, response);
    }

    String idlocale = request.getAttribute("idlocale").toString();
%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib uri="/WEB-INF/tlds/asportoonline.tld" prefix="asportoonline" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>AsportoOnline | Registra prodotto</title>
        <style type="text/css">
            @import url("style.css");
        </style>
    </head>
    <body>
        <div class="meister">
            <div class="page">
                <div class="container">
                    <%@ include file="/WEB-INF/common/header.jsp"%>
                    <div class="navigation"> <a id="first" href="MainController?q=index">Home</a> > <a href="MainController?q=fetch_restaurants_data_action&amp;ret=list_restaurants">I miei locali</a> > <a href="MainController?q=fetch_restaurant_details_action&amp;ret=restaurant_details&amp;idlocale=<%=idlocale%>">Dettagli locale</a> > Inserisci prodotto </div>

                    <div class="uniform_background">
                        <div class="center">

                            <h1>Registra nuovo prodotto</h1>

                            <form class="smallform" method="POST" action="MainController?q=register_product_action">
                                <input type="hidden" name="idlocale" value="<%=idlocale%>" />
                                <fieldset><legend><em>Dati del prodotto</em></legend>
                                    <label>Nome<br /><input name="nome" value="pasta" /></label><br />
                                    <label>Categoria</label><br />
                                    <label><select name="categoria"><asportoonline:elenco_categorie lista_categorie="${lista_categorie}"/></select></label><br />
                                    <label>Descrizione<br /><input name="descrizione" value="Ciao ciao!" /></label><br />
                                    <label>Prezzo<br /><input id="prezzo" name="prezzo" value="5.00" /> &euro;</label><br />
                                    <label>Immagine<br /><input name="urlimmagine" value="default_food.png"/></label><br />
                                    <br /><p class="error">${error}</p><br />
                                    <input type="submit" value="REGISTRA"/>
                                </fieldset>
                            </form>
                            <br />
                        </div>
                    </div>

                    <%@ include file="/WEB-INF/common/footer.jsp"%>
                                    
                </div>
            </div>
        </div>
    </body>
</html>
